package com.example.vv.service;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;

import javax.annotation.Resource;

@SpringBootTest
public class DateRange {

    @Resource
    private JavaMailSender javaMailSender;

    @Test
    void dddTest() throws Exception {
        SimpleMailMessage message = new SimpleMailMessage();
        // 发件人
        message.setFrom("342252328@qq.com");
        // 收件人(可实现批量发送)
        message.setTo("342252328@qq.com");
        // 邮箱标题
        message.setSubject("腾讯新闻");
        // 邮箱内容
        message.setText("腾讯新闻");
        // 发送邮件
        javaMailSender.send(message);

        MimeMessageHelper helper = new MimeMessageHelper(javaMailSender.createMimeMessage(), true);
    }


}
